package com.wjw.bms.dao.impl;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.wjw.bms.dao.HzMenuDao;
import com.wjw.bms.model.HzMenu;

@Repository
public class HzMenuDaoImpl extends SqlSessionDaoSupport implements HzMenuDao {

	String ns = "com.wjw.bms.mapper.HzMenuMapper.";
	/**
	 * 与数据库交互，查询出父菜单
	* @Title: getHzMenu 
	* @Description: TODO 
	* @return  返回值为一个集合，元素为父菜单ID,Name,上级菜单Id,上级菜单Name
	* @see com.wjw.bms.dao.HzMenuDao#getHzMenu()
	 */
	public List<HzMenu> getHzMenu() {
		List<HzMenu> menuList = this.getSqlSession().selectList(ns+"selectToChildMenu");
		return menuList;
	}
	/**
	 * 与数据库交互，查询子菜单
	* @Title: getHzPreviousMenu 
	* @Description: TODO 
	* @return 返回值为一个集合，元素为子菜单
	* @see com.wjw.bms.dao.HzMenuDao#getHzPreviousMenu()
	 */
	public List<HzMenu> getHzPreviousMenu() {
		List<HzMenu> previousMenuList = this.getSqlSession().selectList(ns+"selectToPreviousMenu");
		return previousMenuList;
	}
	/**
	 * 查询所有菜单 
	* @Title: getHzTreeMenu 
	* @Description: TODO 
	* @return 
	* @see com.wjw.bms.dao.HzMenuDao#getHzTreeMenu()
	 */
	public List<HzMenu> getHzTreeMenu() {
		List<HzMenu> allMenuList = this.getSqlSession().selectList(ns+"selectToAllMenu");
		return allMenuList;
	}

}
